Ignore malformed manifests on git dependencies
authorFabien Antoine <fab.antoine@gmail.com>
Fri, 5 May 2017 09:53:56 +0000 (11:53 +0200)
committerGitHub <noreply@github.com>
Fri, 5 May 2017 09:53:56 +0000 (11:53 +0200)
src/cargo/ops/cargo_read_manifest.rs

index 5c25edbf1c9ec20078e4f28b90533510c0f27d22..91a579aff71d7edf713f6b5ebfa50bb13b9a1c94 100644 (file)
@@ -121,7 +121,16 @@ fn read_nested_packages(path: &Path,
 
     let manifest_path = find_project_manifest_exact(path, "Cargo.toml")?;
 
-    let (manifest, nested) = read_manifest(&manifest_path, source_id, config)?;
+    let result = read_manifest(&manifest_path, source_id, config);
+
+    // Ignore malformed manifests
+    if result.is_err() {
+        info!("skipping malformed package found at `{}`",
+              path.to_string_lossy());
+        return Ok(());
+    }
+
+    let (manifest, nested) = result.unwrap();
     let manifest = match manifest {
         EitherManifest::Real(manifest) => manifest,
         EitherManifest::Virtual(..) => return Ok(()),